<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="google.maps" tagdir="/WEB-INF/tags/googlemaps"%>

<div>
    <div class="map-form">
        <s:form action="savePacient">
            <s:fielderror />
            <table>
                <tr>
                        <td colspan="2"></td>
                </tr>
                <tr>
                    <td>
                        <label>Nombre</label>
                    </td>
                    <td><s:hidden name="pacient.id" value="%{pacient.id}" />
                        <s:textfield name="pacient.nombre" label="Nombre" value="%{pacient.nombre}" />
                    </td>
                </tr>
                <tr>
                    <td><label>Apellido</label>
                    </td>
                    <td><s:textfield name="pacient.apellido" label="Apellido"
                                    value="%{pacient.apellido}" />
                    </td>
                </tr>
                <tr>
                    <td><label>Documento</label>
                    </td>
                    <td><s:textfield name="pacient.documento" label="Documento"
                                    value="%{pacient.documento}" />
                    </td>
                </tr>
                <tr>
                    <td><s:label value="Sexo" /></td>
                    <td><s:select name="sexo" label="Sexo"
                                    list="#{'M':'Masculino','F':'Femenino'}" /></td>
                </tr>
               
                <tr>
                    <td><label>Provincia</label>
                    </td>
                    <td><s:textfield name="pacient.location.province"
                                    value="%{pacient.location.province}" label="Provincia" />
                    </td>
                </tr>
                <tr>
                    <td><label>Partido</label>
                    </td>
                    <td><s:textfield name="pacient.location.district"
                                    value="%{pacient.location.district}" label="Partido" />
                    </td>
                </tr>
                <tr>
                    <td><label>Ciudad</label>
                    </td>
                    <td><s:textfield name="pacient.location.city"
                                    value="%{pacient.location.city}" label="Ciudad" />
                    </td>
                </tr>
                <tr>
                    <td><label>Calle</label>
                    </td>
                    <td><s:textfield name="pacient.location.street"
                                    value="%{pacient.location.street}" label="calle" />
                    </td>
                </tr>
                <tr>
                    <td><label>Número</label>
                    </td>
                    <td><s:textfield name="pacient.location.number"
                                    value="%{pacient.location.number}" label="Número" />
                    </td>
                </tr>
                <tr>
                    <td><label>Condiciones habitacionales</label>
                    </td>
                    <td><s:textfield name="pacient.condicionesHabitacionales"
                                    value="%{pacient.condicionesHabitacionales}" label="Condiciones habitacionales"/></td>
                </tr>
                <tr>
                    <td><label>Latitude</label>
                    </td>
                    <td><s:textfield name="pacient.location.latitude"
                                    value="%{pacient.location.latitude}" label="Latitud"
                                    id="latitude" /></td>
                </tr>
                <tr>
                    <td><label>Longitude</label>
                    </td>
                    <td><s:textfield name="pacient.location.longitude"
                                    value="%{pacient.location.longitude}" label="Longitud"
                                    id="longitude" /></td>
                </tr>
                
            </table>
            <s:submit value="guardar" />
        </s:form>
    </div>
    <div id="map" class="map" ></div>
</div>
<div style="clear: both"></div>

<google.maps:Script />
<s:set var="pacient" value="pacient" scope="request" />
<google.maps:Map container_id="map"
	latitude="${empty pacient.location.latitude ? -34.9212936704915 : pacient.location.latitude}"
	longitude="${(empty pacient.location.longitude) ? -57.9546511173248 : pacient.location.longitude}"
	zoom="13">
	<google.maps:LatLngInputField latitude_id="latitude"
		longitude_id="longitude" />
</google.maps:Map>